package cn.wolfcode.wolf2w.business.service.impl;

import cn.wolfcode.wolf2w.business.api.domain.Banner;
import cn.wolfcode.wolf2w.business.mapper.BannerMapper;
import cn.wolfcode.wolf2w.business.query.BannerQuery;
import cn.wolfcode.wolf2w.business.service.IBannerService;
import cn.wolfcode.wolf2w.common.core.constant.SecurityConstants;
import cn.wolfcode.wolf2w.common.core.context.SecurityContextHolder;
import cn.wolfcode.wolf2w.member.api.RemoteUserInfoService;
import cn.wolfcode.wolf2w.member.api.domain.UserInfo;
import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 文章推荐Service业务层处理
 *
 * @author 王南棕
 * @date 2025-09-15
 */
@Service
@Transactional
public class BannerServiceImpl extends ServiceImpl<BannerMapper,Banner> implements IBannerService {

    @Autowired
    private RemoteUserInfoService remoteUserInfoService;
    @Override
    public IPage<Banner> queryPage(BannerQuery qo) {
        IPage<Banner> page = new Page<>(qo.getCurrentPage(), qo.getPageSize());
        return lambdaQuery()
                .page(page);
    }

    @Override
    public List<Banner> querytravel(int  type) {
        return lambdaQuery()
                .eq(Banner::getType,type)
                .list();
    }

    @Override
    public List<Banner> queryStrategy(int  type) {
        //查询攻略
        return lambdaQuery()
                .eq(Banner::getType,type)
                .list();
    }

}
